<template>
  <div>
    <div>
      <Commonhead datum="我的收藏" @click.native="back"></Commonhead>
      <Postcenter
        :Postdata="item"
        v-for="item in postList"
        :key="item.id"
      ></Postcenter>
    </div>
  </div>
</template>

<script>
import Commonhead from "../../components/Commonhead";
import Postcenter from "../../components/Postcenter";
export default {
  components: { Commonhead, Postcenter },
  data() {
    return {
      postList: [],
    };
  },
  methods: {
    back() {
      this.$router.push("/mycenter");
    },
  },

  created() {
    // this.$axios({
    //   url: "post_star/2",
    //   headers: { Authorization: localStorage.getItem("token") },
    // }).then((res) => {
    //   console.log(res.data);
    // });
    this.$axios({
      url: "user_star",
      headers: { Authorization: localStorage.getItem("token") },
    }).then((res) => {
      console.log(res.data);
      this.postList = res.data.data;
    });
  },
};
</script>

<style>
</style>